package com.chartboost.sdk.impl;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.Path;
import android.graphics.Path.Direction;
import android.graphics.RectF;
import android.graphics.Shader;
import android.graphics.Shader.TileMode;
import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics;
import android.widget.Button;

public class f extends Button
{
  private Path a;
  private Path b;
  private Path c;
  private RectF d;
  private Paint e;
  private Paint f;
  private Shader g;
  private Shader h;
  private int i;

  public f(Context paramContext)
  {
    super(paramContext);
    a(paramContext);
  }

  private void a()
  {
    int j = getHeight();
    if (j == this.i)
      return;
    this.i = j;
    int[] arrayOfInt1 = { -81366, -89600, -97280 };
    this.g = new LinearGradient(0.0F, 0.0F, 0.0F, getHeight(), arrayOfInt1, null, Shader.TileMode.CLAMP);
    int[] arrayOfInt2 = { -97280, -89600, -81366 };
    this.h = new LinearGradient(0.0F, 0.0F, 0.0F, getHeight(), arrayOfInt2, null, Shader.TileMode.CLAMP);
  }

  private void a(Context paramContext)
  {
    float f1 = paramContext.getResources().getDisplayMetrics().density;
    setTextSize(2, 13.0F);
    setShadowLayer(1.0F * f1, 1.0F * f1, 1.0F * f1, -16757901);
    setTypeface(null, 1);
    setTextColor(-1);
    setClickable(true);
    setGravity(17);
    setPadding(Math.round(12.0F * f1), Math.round(5.0F * f1), Math.round(12.0F * f1), Math.round(f1 * 5.0F));
    this.a = new Path();
    this.b = new Path();
    this.c = new Path();
    this.d = new RectF();
    this.e = new Paint();
    this.e.setStyle(Paint.Style.STROKE);
    this.e.setColor(-4496384);
    this.e.setAntiAlias(true);
    this.i = -1;
    this.f = new Paint();
    this.f.setStyle(Paint.Style.FILL);
    this.f.setAntiAlias(true);
    setBackgroundDrawable(new Drawable()
    {
      boolean a = false;

      public void draw(Canvas paramAnonymousCanvas)
      {
        int i = 0;
        float f1 = f.this.getContext().getResources().getDisplayMetrics().density;
        int[] arrayOfInt = getState();
        int j = 0;
        float f2;
        Paint localPaint;
        if (i >= arrayOfInt.length)
        {
          f2 = 6.0F * f1;
          f.a(f.this).reset();
          f.b(f.this).set(getBounds());
          f.a(f.this).addRoundRect(f.b(f.this), f2, f2, Path.Direction.CW);
          f.c(f.this);
          localPaint = f.d(f.this);
          if (j == 0)
            break label334;
        }
        label334: for (Shader localShader = f.e(f.this); ; localShader = f.f(f.this))
        {
          localPaint.setShader(localShader);
          paramAnonymousCanvas.drawPath(f.a(f.this), f.d(f.this));
          float f3 = 1.0F * f1;
          f.g(f.this).reset();
          f.b(f.this).inset(f3 / 2.0F, f3 / 2.0F);
          f.g(f.this).addRoundRect(f.b(f.this), f2, f2, Path.Direction.CW);
          f.h(f.this).reset();
          f.b(f.this).offset(0.0F, f3 / 2.0F);
          f.h(f.this).addRoundRect(f.b(f.this), f2, f2, Path.Direction.CW);
          if (j == 0)
          {
            f.i(f.this).setColor(-1);
            paramAnonymousCanvas.drawPath(f.h(f.this), f.i(f.this));
          }
          f.i(f.this).setColor(-4496384);
          paramAnonymousCanvas.drawPath(f.g(f.this), f.i(f.this));
          return;
          if (arrayOfInt[i] == 16842919)
            j = 1;
          i++;
          break;
        }
      }

      public int getOpacity()
      {
        return 1;
      }

      public boolean isStateful()
      {
        return true;
      }

      protected boolean onStateChange(int[] paramAnonymousArrayOfInt)
      {
        int i = 0;
        boolean bool = false;
        while (true)
        {
          if (i >= paramAnonymousArrayOfInt.length)
          {
            if (this.a == bool)
              break;
            this.a = bool;
            invalidateSelf();
            return true;
          }
          if (paramAnonymousArrayOfInt[i] == 16842919)
            bool = true;
          i++;
        }
        return false;
      }

      public void setAlpha(int paramAnonymousInt)
      {
        f.i(f.this).setAlpha(paramAnonymousInt);
        f.d(f.this).setAlpha(paramAnonymousInt);
      }

      public void setColorFilter(ColorFilter paramAnonymousColorFilter)
      {
        f.i(f.this).setColorFilter(paramAnonymousColorFilter);
        f.d(f.this).setColorFilter(paramAnonymousColorFilter);
      }
    });
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.chartboost.sdk.impl.f
 * JD-Core Version:    0.6.2
 */